<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
    <style>
        a{text-decoration: none;font-size: 14px;text-align: center}
        a:link{color:#cccccc}
        a:hover{color: white}
        .center{width: 1200px;margin: 0 auto}
        .el-dropdown-link {
            cursor: pointer;
            color: #409EFF;
        }
        .el-icon-arrow-down {
            font-size: 12px;
        }
        .el-select .el-input {
            width: 130px;
        }
        .input-with-select .el-input-group__prepend {
            background-color: #fff;
        }
    </style>
</head>
<body>
<div id="app">
    <el-container>
        <my-header></my-header>
        <el-main>
            <div style="width: 1200px;margin: 0 auto">
                <el-button type="primary" @click="pay">支付</el-button>
            </div>
        </el-main>
        <el-footer style="margin: 0;padding: 0">
           <my-footer></my-footer>
        </el-footer>

    </el-container>
</div>




<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<!--引入Axios-->
<script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
<script src="js/my-header.js"></script>
<script src="js/my-footer.js"></script>


<script>
    let v = new Vue({
        el: '#app',
        data: function () {

        },
        methods: {
            pay(){
                axios.post("/alipay/trade",v.order).then(function (response) {
                    const div=document.createElement('div')
                    div.innerHTML = response.data;
                    document.body.appendChild(div);
                    document.forms['punchout_form'].setAttribute('target','_blank');
                    document.forms['punchout_form'].submit()
                })
            }
        },

    })
</script>
</body>
</html>